﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace PRE.Login
{
    public partial class FrmLogin : DevExpress.XtraEditors.XtraForm
    {
        public FrmLogin()
        {
            InitializeComponent();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
            Application.Exit();
        }

        private void btnLogin_Click(object sender, EventArgs e)
        {
            var sss = (new BLL.ThanhvienBLL()).CheckLogin(txtUser.Text, txtPass.Text);
            if (sss.Login)
            {
                FrmMain._sss = sss;
                //MessageBox.Show("dang nhap thanh cong", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Close();
               // break;
            }
            else
            {
                MessageBox.Show("Lỗi! Tài khoản hoặc mật khẩu không đúng", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
//                y = x + y;
              //  FrmLogin_Load(sender, e);
              //  break;
            }
        }

        private void FrmLogin_Load(object sender, EventArgs e)
        {

        }
    }
}